/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.ibiz.demo.srv.demo.demodel;


import java.io.Serializable;
import java.util.ArrayList;
import org.hibernate.SessionFactory;
import net.ibizsys.paas.core.DEDataSetCond;
import net.ibizsys.paas.logic.ICondition;
import net.ibizsys.paas.core.IDEDataSetCond;
import net.ibizsys.paas.core.ISystem;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.sysmodel.SysModelGlobal;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;
import net.ibizsys.paas.view.IView;
import net.ibizsys.paas.core.IDEFSearchMode;
import net.ibizsys.paas.core.IDEField;
import net.ibizsys.paas.demodel.DEFSearchModeModel;
import net.ibizsys.paas.demodel.DEFieldModel;
import net.ibizsys.paas.demodel.DEMainStateModel;
import net.ibizsys.paas.demodel.DEDataSyncModel;
import net.ibizsys.paas.demodel.DEActionWizardGroupModel;
import net.ibizsys.paas.demodel.DEActionWizardModel;
import net.ibizsys.paas.demodel.DEDataSetDEAWModel;
import net.ibizsys.paas.demodel.DEActionWizardItemModel;
import net.ibizsys.paas.demodel.IDEActionWizardModel;
import net.ibizsys.paas.core.IDEDataQuery;
import net.ibizsys.paas.core.IDEDataSet;
import net.ibizsys.paas.core.IDEAction;
import net.ibizsys.paas.core.IDEACMode;
import net.ibizsys.paas.core.IDELogic;
import net.ibizsys.paas.core.IDEUIAction;
import net.ibizsys.paas.core.IDEWF;
import net.ibizsys.paas.core.IDEMainState;
import net.ibizsys.paas.core.IDEDataImport;
import net.ibizsys.paas.report.IPrintService;
import net.ibizsys.paas.report.IReportService;
import net.ibizsys.paas.demodel.IDEDataExportModel;


import com.sa.ibiz.demo.srv.MyTestSysSysModel;

import com.sa.ibiz.demo.srv.demo.entity.IBZ5CUSTOMERMG2;
import com.sa.ibiz.demo.srv.demo.service.IBZ5CUSTOMERMG2Service;


/**
 * 实体[IBZ5CUSTOMERMG2]模型对象
 */
public class IBZ5CUSTOMERMG2DEModel extends net.ibizsys.paas.demodel.DataEntityModelBase<IBZ5CUSTOMERMG2>  {

    public IBZ5CUSTOMERMG2DEModel() throws Exception {
        super();

        this.setId("cf1fa71db1001bb7f082e9c65fc07b6c");
        this.setName("IBZ5CUSTOMERMG2");
        this.setTableName("");
        this.setViewName("V_IBZ5CUSTOMERMG2");
        this.setLogicName("客户管理（虚拟实体）");
        this.setDSLink("DEFAULT");
        this.setDataAccCtrlMode(1);
        this.setAuditMode(0);
        DEModelGlobal.registerDEModel("com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DEModel",this);
        this.prepareModels();

        //注册到系统中
        this.getMyTestSysSysModel().registerDataEntityModel(this);
    }

    /**
     * 获取实体[IBZ5CUSTOMERMG2]模型对象
     * @return
     * @throws Exception
     */
    public static IBZ5CUSTOMERMG2DEModel getInstance() throws Exception {
        return (IBZ5CUSTOMERMG2DEModel)DEModelGlobal.getDEModel(IBZ5CUSTOMERMG2DEModel.class);
    }


    private MyTestSysSysModel myTestSysSysModel;
    /**
     * 获取当前系统[MyTestSys]模型对象
     * @return
     */
    public  MyTestSysSysModel getMyTestSysSysModel() {
        if(this.myTestSysSysModel==null) {
            try {
                this.myTestSysSysModel = (MyTestSysSysModel)SysModelGlobal.getSystem("com.sa.ibiz.demo.srv.MyTestSysSysModel");
            } catch(Exception ex) {
            }
        }
        return this.myTestSysSysModel;
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#getSystem()
     */
    @Override
    public  ISystem getSystem() {
        return this.getMyTestSysSysModel();
    }

    private IBZ5CUSTOMERMG2Service iBZ5CUSTOMERMG2Service;

    /**
     * 获取实际实体服务对象
     * @return
     */
    public  IBZ5CUSTOMERMG2Service getRealService() {
        if(this.iBZ5CUSTOMERMG2Service==null) {
            try {
                this.iBZ5CUSTOMERMG2Service = (IBZ5CUSTOMERMG2Service)ServiceGlobal.getService(getServiceId());
            } catch(Exception ex) {
            }
        }
        return this.iBZ5CUSTOMERMG2Service;
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.IDataEntityModel#getService()
     */
    @Override
    public IService getService() {
        return this.getRealService();
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.IDataEntityModel#getServiceId()
     */
    @Override
    public String getServiceId() {
        return "com.sa.ibiz.demo.srv.demo.service.IBZ5CUSTOMERMG2Service";
    }


    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.IDataEntityModel#createEntity()
     */
    @Override
    public IBZ5CUSTOMERMG2 createEntity() {
        return new IBZ5CUSTOMERMG2();
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEFields()
     */
    @Override
    protected void prepareDEFields() throws Exception {
        IDEField iDEField = null;
        IDEFSearchMode iDEFSearchMode = null;
        //注册属性 "ADDRESS"
        iDEField = this.createDEField("ADDRESS");
        if(iDEField==null) {
            DEFieldModel deFieldModel = new DEFieldModel();
            deFieldModel.setDataEntity(this);
            deFieldModel.setId("34d72efff9b2390041456365c87e6b49");
            deFieldModel.setName("ADDRESS");
            deFieldModel.setLogicName("地址");
            deFieldModel.setDataType("INHERIT");
            deFieldModel.setStdDataType(25);
            deFieldModel.setLinkDEField(true);
            deFieldModel.setInheritDEField(true);
            deFieldModel.setImportOrder(1000);
            deFieldModel.setImportTag("");
            deFieldModel.setDERName("DERMULINH_IBZ5CUSTOMERMG2_IBZ5CUSTOMER");
            deFieldModel.setLinkDEFName("ADDRESS");
            deFieldModel.setPhisicalDEField(false);
            deFieldModel.setValueFormat("%1$s");
            deFieldModel.init();
            iDEField = deFieldModel;
        }
        this.registerDEField(iDEField);
        //注册属性 "BANKACCOUNTNUM"
        iDEField = this.createDEField("BANKACCOUNTNUM");
        if(iDEField==null) {
            DEFieldModel deFieldModel = new DEFieldModel();
            deFieldModel.setDataEntity(this);
            deFieldModel.setId("158fab586422b40d02d378e1fbaba46a");
            deFieldModel.setName("BANKACCOUNTNUM");
            deFieldModel.setLogicName("开户银行号");
            deFieldModel.setDataType("INHERIT");
            deFieldModel.setStdDataType(25);
            deFieldModel.setLinkDEField(true);
            deFieldModel.setInheritDEField(true);
            deFieldModel.setImportOrder(1000);
            deFieldModel.setImportTag("");
            deFieldModel.setDERName("DERMULINH_IBZ5CUSTOMERMG2_IBZ5ACCOUNT");
            deFieldModel.setLinkDEFName("BANKACCOUNTNUM");
            deFieldModel.setPhisicalDEField(false);
            deFieldModel.setValueFormat("%1$s");
            deFieldModel.init();
            iDEField = deFieldModel;
        }
        this.registerDEField(iDEField);
        //注册属性 "BANKNAME"
        iDEField = this.createDEField("BANKNAME");
        if(iDEField==null) {
            DEFieldModel deFieldModel = new DEFieldModel();
            deFieldModel.setDataEntity(this);
            deFieldModel.setId("19da0da69b539a74af6932e9ddf7ca04");
            deFieldModel.setName("BANKNAME");
            deFieldModel.setLogicName("开户行");
            deFieldModel.setDataType("INHERIT");
            deFieldModel.setStdDataType(25);
            deFieldModel.setLinkDEField(true);
            deFieldModel.setInheritDEField(true);
            deFieldModel.setImportOrder(1000);
            deFieldModel.setImportTag("");
            deFieldModel.setDERName("DERMULINH_IBZ5CUSTOMERMG2_IBZ5ACCOUNT");
            deFieldModel.setLinkDEFName("BANKNAME");
            deFieldModel.setPhisicalDEField(false);
            deFieldModel.setValueFormat("%1$s");
            deFieldModel.init();
            iDEField = deFieldModel;
        }
        this.registerDEField(iDEField);
        //注册属性 "CUSTOMERUID"
        iDEField = this.createDEField("CUSTOMERUID");
        if(iDEField==null) {
            DEFieldModel deFieldModel = new DEFieldModel();
            deFieldModel.setDataEntity(this);
            deFieldModel.setId("8565c95943bcdbe0f368ef890c0a42a0");
            deFieldModel.setName("CUSTOMERUID");
            deFieldModel.setLogicName("客户编号");
            deFieldModel.setDataType("INHERIT");
            deFieldModel.setStdDataType(25);
            deFieldModel.setLinkDEField(true);
            deFieldModel.setInheritDEField(true);
            deFieldModel.setImportOrder(1000);
            deFieldModel.setImportTag("");
            deFieldModel.setDERName("DERMULINH_IBZ5CUSTOMERMG2_IBZ5CUSTOMER");
            deFieldModel.setLinkDEFName("CUSTOMERUID");
            deFieldModel.setPhisicalDEField(false);
            deFieldModel.setValueFormat("%1$s");
            deFieldModel.init();
            iDEField = deFieldModel;
        }
        this.registerDEField(iDEField);
        //注册属性 "IBZ5CUSTOMERID"
        iDEField = this.createDEField("IBZ5CUSTOMERID");
        if(iDEField==null) {
            DEFieldModel deFieldModel = new DEFieldModel();
            deFieldModel.setDataEntity(this);
            deFieldModel.setId("7a825db989eb34f91248f171e33eb376");
            deFieldModel.setName("IBZ5CUSTOMERID");
            deFieldModel.setLogicName("客户标识");
            deFieldModel.setDataType("INHERIT");
            deFieldModel.setStdDataType(25);
            deFieldModel.setKeyDEField(true);
            deFieldModel.setLinkDEField(true);
            deFieldModel.setInheritDEField(true);
            deFieldModel.setImportOrder(1000);
            deFieldModel.setImportTag("");
            deFieldModel.setDERName("DERMULINH_IBZ5CUSTOMERMG2_IBZ5CUSTOMER");
            deFieldModel.setLinkDEFName("IBZ5CUSTOMERID");
            deFieldModel.setPhisicalDEField(false);
            deFieldModel.setValueFormat("%1$s");
            deFieldModel.init();
            iDEField = deFieldModel;
        }
        this.registerDEField(iDEField);
        //注册属性 "IBZ5CUSTOMERNAME"
        iDEField = this.createDEField("IBZ5CUSTOMERNAME");
        if(iDEField==null) {
            DEFieldModel deFieldModel = new DEFieldModel();
            deFieldModel.setDataEntity(this);
            deFieldModel.setId("1f20531945cc72a1de2a03f5e5a3dd34");
            deFieldModel.setName("IBZ5CUSTOMERNAME");
            deFieldModel.setLogicName("客户名称");
            deFieldModel.setDataType("INHERIT");
            deFieldModel.setStdDataType(25);
            deFieldModel.setMajorDEField(true);
            deFieldModel.setLinkDEField(true);
            deFieldModel.setInheritDEField(true);
            deFieldModel.setImportOrder(1000);
            deFieldModel.setImportTag("");
            deFieldModel.setDERName("DERMULINH_IBZ5CUSTOMERMG2_IBZ5CUSTOMER");
            deFieldModel.setLinkDEFName("IBZ5CUSTOMERNAME");
            deFieldModel.setPhisicalDEField(false);
            deFieldModel.setValueFormat("%1$s");
            deFieldModel.init();
            iDEField = deFieldModel;
        }
        this.registerDEField(iDEField);

    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEACModes()
     */
    @Override
    protected void prepareDEACModes() throws Exception {
        //注册  DEFAULT
        IDEACMode _defaultACModel = (IDEACMode)this.getMyTestSysSysModel().createObject("com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DefaultACModel");
        _defaultACModel.init(this);
        this.registerDEACMode(_defaultACModel);
    }


    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataSets()
     */
    @Override
    protected void prepareDEDataSets() throws Exception {
        //注册  DEFAULT
        IDEDataSet _defaultDSModel = (IDEDataSet)this.getMyTestSysSysModel().createObject("com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DefaultDSModel");
        _defaultDSModel.init(this);
        this.registerDEDataSet(_defaultDSModel);
    }




    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataQueries()
     */
    @Override
    protected void prepareDEDataQueries() throws Exception {
        //注册  DEFAULT
        IDEDataQuery _defaultDQModel =(IDEDataQuery)this.getMyTestSysSysModel().createObject("com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DefaultDQModel");
        _defaultDQModel.init(this);
        this.registerDEDataQuery(_defaultDQModel);
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEActions()
     */
    @Override
    protected void prepareDEActions() throws Exception {

    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDELogics()
     */
    @Override
    protected void prepareDELogics() throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEUIActions()
    */
    @Override
    protected void prepareDEUIActions() throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEWFs()
     */
    @Override
    protected void prepareDEWFs() throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEMainStates()
     */
    @Override
    protected void prepareDEMainStates() throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataSyncs()
     */
    @Override
    protected void prepareDEDataSyncs() throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#preparePDTDEViews()
     */
    @Override
    protected void preparePDTDEViews() throws Exception {
        //注册视图 客户管理（虚拟实体）实体表格视图
        this.registerPDTDEView("MDATAVIEW","3a41b05598bacbe32f71cc7defcebc82");
        //注册视图 客户管理（虚拟实体）实体数据多项选择视图
        this.registerPDTDEView("MPICKUPVIEW","dc4c924299d2637a4ba37a78df6c6b87");
        //注册视图 客户管理（虚拟实体）实体数据选择视图
        this.registerPDTDEView("PICKUPVIEW","fec94bdf4fce54e08d3dd100cb6cdd18");
        //注册视图 客户管理（虚拟实体）实体数据重定向视图
        this.registerPDTDEView("REDIRECTVIEW","28cdf12d8c1f9b15cd18fb0cfd72ea31");
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEOPPrivTagMaps()
     */
    @Override
    protected void prepareDEOPPrivTagMaps()throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEPrints()
     */
    @Override
    protected void prepareDEPrints()throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEReports()
     */
    @Override
    protected void prepareDEReports()throws Exception {
    }


    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEDataExports()
     */
    @Override
    protected void prepareDEDataExports() throws Exception {

    }


    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEActionWizards()
     */
    @Override
    protected void prepareDEActionWizards() throws Exception {
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#prepareDEActionWizardGroups()
     */
    @Override
    protected void prepareDEActionWizardGroups() throws Exception {
    }



    /* (non-Javadoc)
     * @see net.ibizsys.paas.demodel.DataEntityModelBase#onFillFetchQuickSearchConditions(net.ibizsys.paas.core.DEDataSetCond, java.lang.String)
     */
    @Override
    protected void onFillFetchQuickSearchConditions(DEDataSetCond groupCondImpl,String strQuickSearch)  throws Exception {
        super.onFillFetchQuickSearchConditions(groupCondImpl,strQuickSearch);

        //放入属性 IBZ5CUSTOMERNAME - 客户名称
        if(true) {
            DEDataSetCond deDataSetCondImpl = new DEDataSetCond();
            deDataSetCondImpl.setCondType(IDEDataSetCond.CONDTYPE_DEFIELD);
            deDataSetCondImpl.setCondOp(ICondition.CONDOP_LIKE);
            deDataSetCondImpl.setDEFName(IBZ5CUSTOMERMG2.FIELD_IBZ5CUSTOMERNAME);
            deDataSetCondImpl.setCondValue(strQuickSearch);
            groupCondImpl.addChildDEDataQueryCond(deDataSetCondImpl);
        }
    }
}